package com.itheima.zuoye2.zuoye3;

public class SilverCard extends  Card{
    public SilverCard(String namuber, String name, String telephone, Double balance) {
        super(namuber, name, telephone, balance);
    }

    public SilverCard() {
    }

    @Override
    public void pay(double amount) {
        if (amount <= getBalance()) {
            setBalance(getBalance() - amount*0.9);  // 减去支付金额
            System.out.println("银卡支付成功，支付金额：" + amount + "，当前余额：" + getBalance());
        } else {
            System.out.println("余额不足，支付失败！");
        }

    }
}
